Integrand size = 31, antiderivative size = 98 \[ \int \frac {\cos (c+d x) \left (A+C \cos ^2(c+d x)\right )}{a+a \cos (c+d x)} \, dx=\frac {(2 A+3 C) x}{2 a}-\frac {(A+2 C) \sin (c+d x)}{a d}+\frac {(2 A+3 C) \cos (c+d x) \sin (c+d x)}{2 a d}-\frac {(A+C) \cos ^2(c+d x) \sin (c+d x)}{d (a+a \cos (c+d x))} \]
1/2*(2*A+3*C)*x/a-(A+2*C)*sin(d*x+c)/a/d+1/2*(2*A+3*C)*cos(d*x+c)*sin(d*x+ c)/a/d-(A+C)*cos(d*x+c)^2*sin(d*x+c)/d/(a+a*cos(d*x+c))
Time = 0.82 (sec) , antiderivative size = 159, normalized size of antiderivative = 1.62 \[ \int \frac {\cos (c+d x) \left (A+C \cos ^2(c+d x)\right )}{a+a \cos (c+d x)} \, dx=\frac {\cos \left (\frac {1}{2} (c+d x)\right ) \sec \left (\frac {c}{2}\right ) \left (4 (2 A+3 C) d x \cos \left (\frac {d x}{2}\right )+4 (2 A+3 C) d x \cos \left (c+\frac {d x}{2}\right )-16 A \sin \left (\frac {d x}{2}\right )-20 C \sin \left (\frac {d x}{2}\right )-4 C \sin \left (c+\frac {d x}{2}\right )-3 C \sin \left (c+\frac {3 d x}{2}\right )-3 C \sin \left (2 c+\frac {3 d x}{2}\right )+C \sin \left (2 c+\frac {5 d x}{2}\right )+C \sin \left (3 c+\frac {5 d x}{2}\right )\right )}{8 a d (1+\cos (c+d x))} \]
(Cos[(c + d*x)/2]*Sec[c/2]*(4*(2*A + 3*C)*d*x*Cos[(d*x)/2] + 4*(2*A + 3*C) *d*x*Cos[c + (d*x)/2] - 16*A*Sin[(d*x)/2] - 20*C*Sin[(d*x)/2] - 4*C*Sin[c + (d*x)/2] - 3*C*Sin[c + (3*d*x)/2] - 3*C*Sin[2*c + (3*d*x)/2] + C*Sin[2*c + (5*d*x)/2] + C*Sin[3*c + (5*d*x)/2]))/(8*a*d*(1 + Cos[c + d*x]))
Time = 0.37 (sec) , antiderivative size = 97, normalized size of antiderivative = 0.99, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.161, Rules used = {3042, 3521, 25, 3042, 3213}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {\cos (c+d x) \left (A+C \cos ^2(c+d x)\right )}{a \cos (c+d x)+a} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\sin \left (c+d x+\frac {\pi }{2}\right ) \left (A+C \sin \left (c+d x+\frac {\pi }{2}\right )^2\right )}{a \sin \left (c+d x+\frac {\pi }{2}\right )+a}dx\) |
\(\Big \downarrow \) 3521 |
\(\displaystyle \frac {\int -\cos (c+d x) (a (A+2 C)-a (2 A+3 C) \cos (c+d x))dx}{a^2}-\frac {(A+C) \sin (c+d x) \cos ^2(c+d x)}{d (a \cos (c+d x)+a)}\) |
\(\Big \downarrow \) 25 |
\(\displaystyle -\frac {\int \cos (c+d x) (a (A+2 C)-a (2 A+3 C) \cos (c+d x))dx}{a^2}-\frac {(A+C) \sin (c+d x) \cos ^2(c+d x)}{d (a \cos (c+d x)+a)}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle -\frac {\int \sin \left (c+d x+\frac {\pi }{2}\right ) \left (a (A+2 C)-a (2 A+3 C) \sin \left (c+d x+\frac {\pi }{2}\right )\right )dx}{a^2}-\frac {(A+C) \sin (c+d x) \cos ^2(c+d x)}{d (a \cos (c+d x)+a)}\) |
\(\Big \downarrow \) 3213 |
\(\displaystyle -\frac {\frac {a (A+2 C) \sin (c+d x)}{d}-\frac {a (2 A+3 C) \sin (c+d x) \cos (c+d x)}{2 d}-\frac {1}{2} a x (2 A+3 C)}{a^2}-\frac {(A+C) \sin (c+d x) \cos ^2(c+d x)}{d (a \cos (c+d x)+a)}\) |
-(((A + C)*Cos[c + d*x]^2*Sin[c + d*x])/(d*(a + a*Cos[c + d*x]))) - (-1/2* (a*(2*A + 3*C)*x) + (a*(A + 2*C)*Sin[c + d*x])/d - (a*(2*A + 3*C)*Cos[c + d*x]*Sin[c + d*x])/(2*d))/a^2
3.1.41.3.1 Defintions of rubi rules used
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*sin[(e_.) + (f_.) *(x_)]), x_Symbol] :> Simp[(2*a*c + b*d)*(x/2), x] + (-Simp[(b*c + a*d)*(Co s[e + f*x]/f), x] - Simp[b*d*Cos[e + f*x]*(Sin[e + f*x]/(2*f)), x]) /; Free Q[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0]
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])^(n_.)*((A_.) + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[a*(A + C)*Cos[e + f*x]*(a + b*Sin[e + f*x])^m*((c + d*Sin[e + f*x])^(n + 1)/(f*(b*c - a*d)*(2*m + 1))), x] + Simp[1/(b*(b*c - a*d)*(2*m + 1)) I nt[(a + b*Sin[e + f*x])^(m + 1)*(c + d*Sin[e + f*x])^n*Simp[A*(a*c*(m + 1) - b*d*(2*m + n + 2)) - C*(a*c*m + b*d*(n + 1)) + (a*A*d*(m + n + 2) + C*(b* c*(2*m + 1) - a*d*(m - n - 1)))*Sin[e + f*x], x], x], x] /; FreeQ[{a, b, c, d, e, f, A, C, n}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0] && LtQ[m, -2^(-1)]
Time = 1.73 (sec) , antiderivative size = 56, normalized size of antiderivative = 0.57
method | result | size |
parallelrisch | \(\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (-2 C \cos \left (d x +c \right )+C \cos \left (2 d x +2 c \right )-4 A -7 C \right )+4 \left (A +\frac {3 C}{2}\right ) x d}{4 a d}\) | \(56\) |
derivativedivides | \(\frac {-A \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) C +\frac {-3 \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) C -\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) C}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2}}+\left (2 A +3 C \right ) \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d a}\) | \(95\) |
default | \(\frac {-A \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) C +\frac {-3 \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) C -\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) C}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2}}+\left (2 A +3 C \right ) \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d a}\) | \(95\) |
risch | \(\frac {x A}{a}+\frac {3 C x}{2 a}+\frac {i {\mathrm e}^{i \left (d x +c \right )} C}{2 a d}-\frac {i {\mathrm e}^{-i \left (d x +c \right )} C}{2 a d}-\frac {2 i A}{d a \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}-\frac {2 i C}{d a \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}+\frac {\sin \left (2 d x +2 c \right ) C}{4 a d}\) | \(117\) |
norman | \(\frac {\frac {\left (2 A +3 C \right ) x}{2 a}-\frac {\left (A +C \right ) \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a d}-\frac {\left (A +2 C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{a d}-\frac {3 \left (A +2 C \right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a d}+\frac {3 \left (2 A +3 C \right ) x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 a}+\frac {3 \left (2 A +3 C \right ) x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 a}+\frac {\left (2 A +3 C \right ) x \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 a}-\frac {\left (3 A +7 C \right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{3}}\) | \(197\) |
Time = 0.26 (sec) , antiderivative size = 77, normalized size of antiderivative = 0.79 \[ \int \frac {\cos (c+d x) \left (A+C \cos ^2(c+d x)\right )}{a+a \cos (c+d x)} \, dx=\frac {{\left (2 \, A + 3 \, C\right )} d x \cos \left (d x + c\right ) + {\left (2 \, A + 3 \, C\right )} d x + {\left (C \cos \left (d x + c\right )^{2} - C \cos \left (d x + c\right ) - 2 \, A - 4 \, C\right )} \sin \left (d x + c\right )}{2 \, {\left (a d \cos \left (d x + c\right ) + a d\right )}} \]
1/2*((2*A + 3*C)*d*x*cos(d*x + c) + (2*A + 3*C)*d*x + (C*cos(d*x + c)^2 - C*cos(d*x + c) - 2*A - 4*C)*sin(d*x + c))/(a*d*cos(d*x + c) + a*d)
Leaf count of result is larger than twice the leaf count of optimal. 665 vs. \(2 (78) = 156\).
Time = 0.76 (sec) , antiderivative size = 665, normalized size of antiderivative = 6.79 \[ \int \frac {\cos (c+d x) \left (A+C \cos ^2(c+d x)\right )}{a+a \cos (c+d x)} \, dx=\begin {cases} \frac {2 A d x \tan ^{4}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{2 a d \tan ^{4}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 4 a d \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 2 a d} + \frac {4 A d x \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{2 a d \tan ^{4}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 4 a d \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 2 a d} + \frac {2 A d x}{2 a d \tan ^{4}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 4 a d \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 2 a d} - \frac {2 A \tan ^{5}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{2 a d \tan ^{4}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 4 a d \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 2 a d} - \frac {4 A \tan ^{3}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{2 a d \tan ^{4}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 4 a d \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 2 a d} - \frac {2 A \tan {\left (\frac {c}{2} + \frac {d x}{2} \right )}}{2 a d \tan ^{4}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 4 a d \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 2 a d} + \frac {3 C d x \tan ^{4}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{2 a d \tan ^{4}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 4 a d \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 2 a d} + \frac {6 C d x \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{2 a d \tan ^{4}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 4 a d \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 2 a d} + \frac {3 C d x}{2 a d \tan ^{4}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 4 a d \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 2 a d} - \frac {2 C \tan ^{5}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{2 a d \tan ^{4}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 4 a d \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 2 a d} - \frac {10 C \tan ^{3}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{2 a d \tan ^{4}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 4 a d \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 2 a d} - \frac {4 C \tan {\left (\frac {c}{2} + \frac {d x}{2} \right )}}{2 a d \tan ^{4}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 4 a d \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 2 a d} & \text {for}\: d \neq 0 \\\frac {x \left (A + C \cos ^{2}{\left (c \right )}\right ) \cos {\left (c \right )}}{a \cos {\left (c \right )} + a} & \text {otherwise} \end {cases} \]
Piecewise((2*A*d*x*tan(c/2 + d*x/2)**4/(2*a*d*tan(c/2 + d*x/2)**4 + 4*a*d* tan(c/2 + d*x/2)**2 + 2*a*d) + 4*A*d*x*tan(c/2 + d*x/2)**2/(2*a*d*tan(c/2 + d*x/2)**4 + 4*a*d*tan(c/2 + d*x/2)**2 + 2*a*d) + 2*A*d*x/(2*a*d*tan(c/2 + d*x/2)**4 + 4*a*d*tan(c/2 + d*x/2)**2 + 2*a*d) - 2*A*tan(c/2 + d*x/2)**5 /(2*a*d*tan(c/2 + d*x/2)**4 + 4*a*d*tan(c/2 + d*x/2)**2 + 2*a*d) - 4*A*tan (c/2 + d*x/2)**3/(2*a*d*tan(c/2 + d*x/2)**4 + 4*a*d*tan(c/2 + d*x/2)**2 + 2*a*d) - 2*A*tan(c/2 + d*x/2)/(2*a*d*tan(c/2 + d*x/2)**4 + 4*a*d*tan(c/2 + d*x/2)**2 + 2*a*d) + 3*C*d*x*tan(c/2 + d*x/2)**4/(2*a*d*tan(c/2 + d*x/2)* *4 + 4*a*d*tan(c/2 + d*x/2)**2 + 2*a*d) + 6*C*d*x*tan(c/2 + d*x/2)**2/(2*a *d*tan(c/2 + d*x/2)**4 + 4*a*d*tan(c/2 + d*x/2)**2 + 2*a*d) + 3*C*d*x/(2*a *d*tan(c/2 + d*x/2)**4 + 4*a*d*tan(c/2 + d*x/2)**2 + 2*a*d) - 2*C*tan(c/2 + d*x/2)**5/(2*a*d*tan(c/2 + d*x/2)**4 + 4*a*d*tan(c/2 + d*x/2)**2 + 2*a*d ) - 10*C*tan(c/2 + d*x/2)**3/(2*a*d*tan(c/2 + d*x/2)**4 + 4*a*d*tan(c/2 + d*x/2)**2 + 2*a*d) - 4*C*tan(c/2 + d*x/2)/(2*a*d*tan(c/2 + d*x/2)**4 + 4*a *d*tan(c/2 + d*x/2)**2 + 2*a*d), Ne(d, 0)), (x*(A + C*cos(c)**2)*cos(c)/(a *cos(c) + a), True))
Time = 0.31 (sec) , antiderivative size = 184, normalized size of antiderivative = 1.88 \[ \int \frac {\cos (c+d x) \left (A+C \cos ^2(c+d x)\right )}{a+a \cos (c+d x)} \, dx=-\frac {C {\left (\frac {\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \frac {3 \, \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}}}{a + \frac {2 \, a \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {a \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}}} - \frac {3 \, \arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a} + \frac {\sin \left (d x + c\right )}{a {\left (\cos \left (d x + c\right ) + 1\right )}}\right )} - A {\left (\frac {2 \, \arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a} - \frac {\sin \left (d x + c\right )}{a {\left (\cos \left (d x + c\right ) + 1\right )}}\right )}}{d} \]
-(C*((sin(d*x + c)/(cos(d*x + c) + 1) + 3*sin(d*x + c)^3/(cos(d*x + c) + 1 )^3)/(a + 2*a*sin(d*x + c)^2/(cos(d*x + c) + 1)^2 + a*sin(d*x + c)^4/(cos( d*x + c) + 1)^4) - 3*arctan(sin(d*x + c)/(cos(d*x + c) + 1))/a + sin(d*x + c)/(a*(cos(d*x + c) + 1))) - A*(2*arctan(sin(d*x + c)/(cos(d*x + c) + 1)) /a - sin(d*x + c)/(a*(cos(d*x + c) + 1))))/d
Time = 0.26 (sec) , antiderivative size = 96, normalized size of antiderivative = 0.98 \[ \int \frac {\cos (c+d x) \left (A+C \cos ^2(c+d x)\right )}{a+a \cos (c+d x)} \, dx=\frac {\frac {{\left (d x + c\right )} {\left (2 \, A + 3 \, C\right )}}{a} - \frac {2 \, {\left (A \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + C \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{a} - \frac {2 \, {\left (3 \, C \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + C \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{2} a}}{2 \, d} \]
1/2*((d*x + c)*(2*A + 3*C)/a - 2*(A*tan(1/2*d*x + 1/2*c) + C*tan(1/2*d*x + 1/2*c))/a - 2*(3*C*tan(1/2*d*x + 1/2*c)^3 + C*tan(1/2*d*x + 1/2*c))/((tan (1/2*d*x + 1/2*c)^2 + 1)^2*a))/d
Time = 1.02 (sec) , antiderivative size = 83, normalized size of antiderivative = 0.85 \[ \int \frac {\cos (c+d x) \left (A+C \cos ^2(c+d x)\right )}{a+a \cos (c+d x)} \, dx=\frac {A\,x}{a}+\frac {3\,C\,x}{2\,a}-\frac {C\,\sin \left (c+d\,x\right )}{a\,d}-\frac {A\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{a\,d}+\frac {C\,\sin \left (2\,c+2\,d\,x\right )}{4\,a\,d}-\frac {C\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{a\,d} \]